package com.hyphenate.chatuidemo.db;

import com.hyphenate.chatuidemo.domain.NewUserEntity;
import java.util.List;

public class NewUserDao {
    public static final String TABLE_NAME = "new_uers";
    public static final String COLUMN_USER_ID = "user_id";
    public static final String COLUMN_USER_IM_ID = "user_im_id";
    public static final String COLUMN_NAME = "nick";
    public static final String COLUMN_NAME_AVATAR = "avatar";
    public static final String COLUMN_ROLE = "role";
    public static final String COLUMN_ROLE_NAME = "role_name";

    /**
     * save contact list
     *
     * @param contactList
     */
    public void saveContactList(final List<NewUserEntity> contactList) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                DemoDBManager.getInstance().saveNewContactList(contactList);
            }
        }).start();
    }

    public void saveContact(NewUserEntity user) {
        DemoDBManager.getInstance().saveNewContact(user);
    }

    public NewUserEntity getUserByUserId(String userId) {
        return DemoDBManager.getInstance().getUserById(userId);
    }

    public NewUserEntity getUserByImId(String imId) {
        return DemoDBManager.getInstance().getUserByImId(imId);
    }
}
